<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['系统配置','修复数据审核']" icon="fa fa-cog" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>修复数据审核</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<div class="top_module">
									<span class="module_text">日志类型</span>
									<select name="" id="" class="module_inp" [(ngModel)]="tableQueryitem.type"  >
										<option value="">全部</option>
										<option value="1">重量修复</option>
										<option value="2">轨迹修复</option>
									</select>
								</div>
								<div class="top_module">
									<span class="module_text">审核状态</span>
									<select name="" id="" class="module_inp" [(ngModel)]="tableQueryitem.isCheck"  >
										<option value="">全部</option>
										<option value="0">未审核</option>
										<option value="1">审核通过</option>
										<option value="2">审核不通过</option>
										<option value="-1">撤销修复</option>
									</select>
								</div>
								<div class="top_module">
									<span class="module_text">公司名称</span>
									<sa-company-tree companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree>                     
								</div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
								
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="tableQueryitem.searchKey" (change)="table_search()" class="search-input" placeholder="车牌,提交日志用户名...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th *ngFor="let item of tableHeardlist">{{item.value}}</th>
										<th >操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i"  [ngClass]="{selected:activeSelected === row.id}"  (dblclick)='checkAbnormal(row,myModal)'>
										<td *ngFor="let item of tableHeardlist">
											
											<span *ngIf='item.keys=="type"||item.keys=="isCheck";else notflag'>
												<span *ngIf='item.keys=="type"'>
													<span *ngIf="row[item.keys]=='1'">重量修复</span>
													<span *ngIf="row[item.keys]=='2'">轨迹修复</span>
												</span>
												<span *ngIf='item.keys=="isCheck"'>
													<span *ngIf="row[item.keys]=='-1'">撤销修复</span>
													
													<span *ngIf="row[item.keys]=='0'" class="orange">未审核</span>
													<span *ngIf="row[item.keys]=='1'" class="green">审核通过</span>
													<span *ngIf="row[item.keys]=='2'" class="red">审核不通过</span>
													
												</span>
											</span>
											
											<ng-template #notflag>
												<span >{{row[item.keys]}}</span>
											</ng-template>
											
										</td>
										<td>
											<button type="button" (click)="checkAbnormal(row,myModal)" >查看</button>
											<button type="button" (click)="setCheckrowMes(row);checkModay.show();" >审核</button>
											<button type="button" (click)="revoke_row(row)" >撤销修复</button>
										</td>
										
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!-- 编辑弹窗 -->
	<div bsModal #myModal="bs-modal" class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog" style="min-width: 1000px;margin: 108px auto;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="myModal.hide()">&times;</button>
					<h4 class="modal-title" id="">
						<div class="widget-body no-padding" style="margin: 0;">
								<div class="page-header clearfix s_table_opreation" style="margin: 0;border-bottom:none;">
									<div class="left page-header-btn" style="padding: 5px;">
										<div class="top_module">
											<span class="module_text" style="background: none;" >异常数据折线图</span>
										</div>
										<div style="display: inline-block;">
											<div>
												<div class="selectDate top_module">
													<table-select-date [notInit]='true' [specifyId]='specifyId' [specifyTime]='specifyTime' (outerTime)="getSelectChartTime($event)" ></table-select-date>
												</div>
												<button type="button" class="btn btn-primary" (click)="drawAbnormalChart()">查看</button>
												<button type="button" class="btn btn-primary" (click)="modalCheckEvent()">快速审核</button>
											</div>
										</div>
									</div>
								</div>
							</div>
					</h4>
				</div>
				<div class="modal-body">
					<div  style="background: white;position: relative;" [hidden]="!isChartView">
						<!--<button (click)="closeChart()" class="div_closeBtn"> × </button>-->
						<chart1-component [height]='325' [width]='1000'  [inputParams]='selectedRow' [isBaiduMap]='true' (outerSend)="runParent($event)" (outerIsMap)='showMapView($event)' ></chart1-component>
						<div [hidden]='!isMapView'>
							<bMap1-component [trackParams]='drawTrackArr' ></bMap1-component>
						</div>
					</div>
				</div>
				<!--<div class="modal-footer" style="clear: both;">
					<button type="button" class="btn btn-default" (click)="myModal.hide()">关闭</button>
					<button type="button" class="btn btn-primary" (click)='submitUpdate(myModal)'>保存</button>
				</div>-->
			</div>
		</div>
	</div>



	<!--审核弹窗-->
	<div bsModal #checkModay="bs-modal" class="modal" id="checkModay" tabindex="-1" role="dialog" aria-labelledby="checkModayLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					审核信息
					<button type="button" class="close" (click)="checkModay.hide()">&times;</button>
				</div>
				<div class="modal-body" >
					<textarea class="handleInfo form-control " [(ngModel)]="checkRemark" cols="30" placeholder="请输入审核意见。" rows="4"></textarea>
				</div>
				<div class="modal-footer" style="clear: both;">
					<button type="button" class="btn btn-danger" (click)='checkRow(2)'>不通过</button>
					<button type="button" class="btn btn-primary" (click)='checkRow(1)'>通过</button>
					<!--<button type="button" class="btn btn-default" (click)="checkModay.hide()">关闭</button>-->
				</div>
			</div>
		</div>
	</div>
</div>
